# DarkMark (C) 2019-2023 Stephane Charette <stephanecharette@gmail.com>


IF (WIN32)
	SET (RT "")
	SET (DL "")
	SET (X11 "")
ELSE ()
	FIND_LIBRARY	( RT		rt			)
	FIND_LIBRARY	( DL		dl			)
	FIND_PACKAGE	( X11		REQUIRED	)
ENDIF ()
FIND_PACKAGE	( Threads	REQUIRED	)
FIND_PACKAGE	( Freetype	REQUIRED	)
INCLUDE_DIRECTORIES ( AFTER ${FREETYPE_INCLUDE_DIRS} )
SET ( JUCE_LIBRARIES ${RT} ${DL} ${X11_LIBRARIES} ${FREETYPE_LIBRARIES} ${GTK3_LIBRARIES} )

# create a list of all the JUCE source files we need to compile
FILE ( GLOB JUCE_SOURCE ${CMAKE_HOME_DIRECTORY}/JuceLibraryCode/*.cpp )
LIST ( SORT JUCE_SOURCE )

ADD_LIBRARY ( dm_juce STATIC ${JUCE_SOURCE} )
TARGET_LINK_LIBRARIES ( dm_juce ${CMAKE_THREAD_LIBS_INIT} ${JUCE_LIBRARIES} )
